﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <meta http-equiv=content-type content="text/html; charset=UTF-8">
    <title>index Test</title>
    <link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.8.18.custom.css" />
    <style>
        body
        {
        	font-family:Verdana;
        }
        input{margin:0px; padding:0px;}
        div{margin:0px; padding:0px;}
        .fl{
            float:left;
        }
        .fr
        {
        	float:right;
        }
        .inputDiv
        {
        	height:300px;
        } 
        #inputHTML
        {
        	height:300px;
        	width:95%;
        }
        .sellb
        {
        	width:5%;
        }
        #inputSel
        {
        	width:91%;
        }
        .output
        {
        	height:580px;
        	width:95%;
        	border:solid 1px #7f9db9;
        }
    </style>
    <script type="text/javascript" language="javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script  type="text/javascript">
        function testSel() {
            $("#filterRet").empty();
            var inputHTML = $("#inputHTML").text();
            var $testObj = $("'" + inputHTML + "'");
            var $in = $("<div/>");
            $testObj.appendTo($in);
            var inputSel = $("#inputSel").val();
            var $seledObj = $(inputSel, $in);
            var $out = $("<div/>");
            $seledObj.appendTo($out);
            $("#filterRet").text($out[0].innerHTML);
        }

        $(function() {
            $("#filter").click(function() {
                testSel();
            })
        })
    </script>
</head>

<body>
    <div>HTML源码</div>
    <div class="inputDiv"><textarea id="inputHTML"></textarea></div>
    <div><label class="sellb">选择器</label><input type="text" id="inputSel"/></div>
    <div class=""><button id="filter"> filter </button></div>
    <div class="output" id="filterRet"></div>
</body>
</html>
